<!--
 * @Description: 呼吸灯-动画
 * @Author: rendc
 * @Date: 2025-09-19 11:12:00
 * @LastEditors: rendc
 * @LastEditTime: 2025-09-19 11:29:21
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>呼吸灯</title>
  <style>
    .square,
    .outer,
    .inner {
      border: 1px solid red;
      /* 更改盒子模型 */
      box-sizing: border-box;
    }

    .square {
      width: 300px;
      height: 300px;
      margin: 0 auto;
      padding: 50px;
      /* kf_outer 动画名*/
      animation-name: kf_square;
      /* 动画执行持续的时间 */
      animation-duration: 10s;
      /* 动画执行过程的速度 - 匀速 */
      animation-timing-function: linear;
      /* 动画启动前延时 */
      animation-delay: 2s;
      /* 动画播放几次 */
      animation-iteration-count: infinite;
    }

    .outer {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      padding: 25px;
      border: 5px solid red;
      animation: kf_outer 10s linear infinite;

    }

    .inner {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      border: 5px solid red;
      /* 速写 */
      animation: kf_inner 10s linear infinite;
    }

    /* 定义动画 关键字 @keyframes 动画名 kf_square*/
    @keyframes kf_square {
      0% {
        padding: 50px;
        border-color: red;
      }

      25% {
        padding: 25px;
      }

      50% {
        padding: 50px;
      }

      75% {
        padding: 25px;
      }

      100% {
        padding: 50px;
        border-color: yellowgreen;
      }

    }

    /* 定义动画 关键字 @keyframes 动画名 kf_outer*/
    @keyframes kf_outer {
      0% {
        border-color: skyblue;
      }

      50% {
        border-color: hotpink;
      }
    }

    /* 定义动画 关键字 @keyframes 动画名 kf_inner*/
    @keyframes kf_inner {
      0% {
        border-color: red;
      }

      50% {
        border-color: yellowgreen;
      }
    }
  </style>
</head>

<body>
  <div class="square">
    <div class="outer">
      <div class="inner"></div>
    </div>
  </div>
</body>

</html>